<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Flashgame
 * @version    $Id: index.tpl 6755 2010 YouNet $
 * @author     To Anh
 */
?>
<h2><?php echo $this->translate("Games Plugin") ?></h2>

<?php if( count($this->navigation) ): ?>
  <div class='tabs'>
    <?php
      // Render the menu
      //->setUlClass()
      echo $this->navigation()->menu()->setContainer($this->navigation)->render()
    ?>
  </div>
<?php endif; ?>

  <div class='clear'>
    <div class='settings'>
      <div>
        <h3><?php echo $this->translate("Users of "). $this->package->package_name . ' package (' . count($this->packageusers) . ').'; ?> </h3>
          <?php if(count($this->packageusers)>0):?>

         <table class='admin_table'>
          <thead>

            <tr>
              <th><?php echo $this->translate("Id") ?></th>
              <th><?php echo $this->translate("Username") ?></th>
              <th><?php echo $this->translate("Email") ?></th>
              <th><?php echo $this->translate("User Level") ?></th>
              <th><?php echo $this->translate("Enable") ?></th>
              <th><?php echo $this->translate("Start Date"); ?></th>
              <th><?php echo $this->translate("Expiration Date") ?></th>
              <th><?php echo $this->translate("Options") ?></th>
            </tr>

          </thead>
          <tbody>
            <?php foreach ($this->packageusers as $user): ?>
              <tr>
                <td><?php echo $user->user_id; ?></td>
                <td><?php echo $user->username  ?></td>
                <td><?php echo $user->email; ?></td>
                
                <td>
                      <?php foreach ($this->user_levels as $user_level): ?>
                        <?php if ($user->level_id==$user_level->level_id) echo $user_level->getTitle(); ?> 
                      <?php endforeach; ?>
                </td>
                <td><?php if ($user->enabled) echo $this->translate('Yes'); else echo $this->translate('No');  ?></td>            
                <td><?php echo $user->userpackage_startdate; ?></td> 
                <td><?php echo $user->userpackage_expiredate; ?></td>             
                <td>
                    <?php //echo $this->htmlLink(array('route' => 'admin_default', 'module' => 'flashgame', 'controller' => 'package', 'action' => 'useredit', 'package_id' =>$this->package->package_id, 'user_id' => $user->user_id), $this->translate('edit'), array('class' => 'smoothbox')) ?> 
                    <?php echo $this->htmlLink(array('route' => 'admin_default', 'module' => 'flashgame', 'controller' => 'package', 'action' => 'userdelete', 'package_id' =>$this->package->package_id, 'user_id' => $user->user_id), $this->translate('delete'), array('class' => 'smoothbox')) ?>

                </td>
              </tr>
            <?php endforeach; ?>
          </tbody>
        </table>
      <?php else:?>
      <br/>
      <div class="tip">
      <span><?php echo $this->translate("Not found a user.") ?></span>
      </div>
      <?php endif;?>
    </div>
    </div>
  </div>